


//资源加载


import { SpriteFrame, resources } from "cc";
import SingLeton from "../Base/SingLeton"
import { ITile } from "../Levels"

export default class ResourceManager extends SingLeton{


    static get Instance(){
        return super.GetInstance<ResourceManager>(

        )
    }


    loadDir(path:string,type :typeof SpriteFrame =  SpriteFrame){
        return new Promise<SpriteFrame[]>((resolve,reject)=>{
        resources.loadDir(path, type, function (err, assets) {
            // ...
            if(err){
                reject(err)
            
            }
            resolve(assets)
        });  
        }
        
    )}


}


// export const DataManagerInstance = new DataManager()  //暴露一个实例






